package br.com.knowledge.persistence.hibernate.entities;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * CadVisao entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cad_visao", schema = "public")
public class CadVisao implements java.io.Serializable {

	// Fields
	private Integer id;
	private String descricao;
	private Timestamp datacriacao;
	private Timestamp dataconclusao;
	private String statusvisao;
	private Set<VisItemvisao> visItemvisaos = new HashSet<VisItemvisao>(0);
	private Set<VisItemvisao> visItemvisaos_1 = new HashSet<VisItemvisao>(0);

	// Constructors

	/** default constructor */
	public CadVisao() {
	}

	/** minimal constructor */
	public CadVisao(String descricao, Timestamp datacriacao, String statusvisao) {
		this.descricao = descricao;
		this.datacriacao = datacriacao;
		this.statusvisao = statusvisao;
	}

	/** full constructor */
	public CadVisao(String descricao, Timestamp datacriacao,
			Timestamp dataconclusao, String statusvisao,
			Set<VisItemvisao> visItemvisaos, Set<VisItemvisao> visItemvisaos_1) {
		this.descricao = descricao;
		this.datacriacao = datacriacao;
		this.dataconclusao = dataconclusao;
		this.statusvisao = statusvisao;
		this.visItemvisaos = visItemvisaos;
		this.visItemvisaos_1 = visItemvisaos_1;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "descricao", nullable = false)
	public String getDescricao() {
		return this.descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@Column(name = "datacriacao", nullable = false, length = 29)
	public Timestamp getDatacriacao() {
		return this.datacriacao;
	}

	public void setDatacriacao(Timestamp datacriacao) {
		this.datacriacao = datacriacao;
	}

	@Column(name = "dataconclusao", length = 29)
	public Timestamp getDataconclusao() {
		return this.dataconclusao;
	}

	public void setDataconclusao(Timestamp dataconclusao) {
		this.dataconclusao = dataconclusao;
	}

	@Column(name = "statusvisao", nullable = false, length = 1)
	public String getStatusvisao() {
		return this.statusvisao;
	}

	public void setStatusvisao(String statusvisao) {
		this.statusvisao = statusvisao;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cadVisao")
	public Set<VisItemvisao> getVisItemvisaos() {
		return this.visItemvisaos;
	}

	public void setVisItemvisaos(Set<VisItemvisao> visItemvisaos) {
		this.visItemvisaos = visItemvisaos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cadVisao")
	public Set<VisItemvisao> getVisItemvisaos_1() {
		return this.visItemvisaos_1;
	}

	public void setVisItemvisaos_1(Set<VisItemvisao> visItemvisaos_1) {
		this.visItemvisaos_1 = visItemvisaos_1;
	}

}